<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/taglibs/iss" prefix="iss"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>MKTB15</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>

<link rel="stylesheet" type="text/css"
	href="../js/window/skin/qq/ymPrompt.css" />
<SCRIPT language=javascript src="../js/window/ymPrompt_Ex.js"
	type=text/javascript></SCRIPT>
<SCRIPT language=javascript src="../js/window/ymPrompt_source.js"
	type=text/javascript></SCRIPT>

<script type="text/javascript">
var strId = new Array();
var strName = new Array();
  
 var areaIds = new Array();
 var areaNames = new Array();  
 
 window.onload = function(){
 	 var id = document.getElementById("stationId").value;
 	
 	 if(null != id && 0 != id.length)
 	 {
 	    var stationId = id.split(",");
 	    for(var i = 0; i < stationId.length; i++)
 	    {
 	       strId.push(stationId[i]); 
 	
 	    }
 	 }
 	 var name = document.getElementById('stationName').value;
 	 
 	 if(null != name && 0 != name.length)
 	 {
 	    var stationName = name.split(",");
 	    
 	    for(var j = 0; j < stationName.length; j++)
 	    {
 	       strName.push(stationName[j]); 
 	    }
 	 }
//  	  var id2 = document.getElementById("areaId").value;
 	
//  	 if(null != id2 && 0 != id2.length)
//  	 {
//  	    var areaId = id2.split(",");
//  	    for(var i = 0; i < areaId.length; i++)
//  	    {
//  	       areaIds.push(areaId[i]); 
 	
//  	    }
//  	 }
//  	 var name2 = document.getElementById('areaName').value;
 	 
//  	 if(null != name2 && 0 != name2.length)
//  	 {
//  	    var areaName = name2.split(",");
 	    
//  	    for(var j = 0; j < areaName.length; j++)
//  	    {
//  	       areaNames.push(areaName[j]); 
//  	    }
//  	 }
 	 
 }
 function openwin()
 {
	ymPrompt.win({message:'../account/queryStationInfo.html',width:800,height:400,title:'岗位信息查询',iframe:true});
 }  
 
 function openAreaWin()
 {
	 ymPrompt.win({message:'../account/queryAreaInfo.html',width:800,height:400,title:'区域信息查询',iframe:true});
 }  
 
 function setAreaValue(ids,names)
 {   
            	 
     var areaId='';
     var areaName ='';
     if(null != ids && 0 != ids.length)
     {
         for(var i = 0; i < ids.length; i++)
         {
             areaId+=ids[i]+",";
         }
     }
      if(null != names && 0 != names.length)
     {
         for(var j = 0; j < names.length; j++)
         {
             areaName+=names[j]+",";
         }
     }
     
     document.getElementById("areaId").value= areaId.substr(0,areaId.length-1);
     
     document.getElementById("areaName").value= areaName.substr(0,areaName.length-1);
                  
     return;
 }
  
 function saveAreaValue(areaId,areaName)
 {    
      var flag = false;
        
      if(null != areaId)
      {     
        if(null != areaIds && 0 != areaIds.length)
        {
           for(var i = 0; i < areaIds.length; i++)
           {
               if(areaIds[i] == areaId)
               {
                  flag = true;   
               }
           }          
        }
        if(!flag)
        {
            areaIds.push(areaId); 
        } 
      }
      if(null != areaName )
      {
        flag = false;
        
        if(null != areaNames && 0 != areaNames.length)
        {
            for(var j = 0; j < areaNames.length; j++)
            {
                if(areaNames[j] == areaName)
                {
                    flag = true;   
                }
            }
        }      
        if(!flag)
        {
           areaNames.push(areaName); 
        }
      
      }
    setAreaValue(areaIds,areaNames);
          
 }
 function delAreaValue(areaId,areaName)
 {      
      if(null != areaId)
      {
         if(null != areaIds && 0 != areaIds.length)
         {
             for(var i = 0; i < areaIds.length; i++)
             {
                if(areaId == areaIds[i])
                {
                    areaIds.splice(i,1);                   
                }
             }
         }       
      }
      if(null != areaName)
      {
         if(null != areaNames && 0 != areaNames.length)
         {
             for(var j = 0; j < areaNames.length; j++)
             {
                if(areaName == areaNames[j])
                {
                    areaNames.splice(j,1);
                }
             }
         }        
      }
      
    setAreaValue(areaIds,areaNames);        
 }
 
  function resetValue()
 {

 	 strId = new Array();
  	 strName = new Array();
		
 	return;
 }
 
 
 function setValue(strId,strName)
 {             	 
     
     var stationId='';
     var stationName ='';

     if(null != strId && 0 != strId.length)
     {
         for(var i = 0; i < strId.length; i++)
         {
             stationId+=strId[i]+",";
         }
     }
      if(null != strName && 0 != strName.length)
     {
         for(var j = 0; j < strName.length; j++)
         {
             stationName+=strName[j]+",";
         }
     }
     
     document.getElementById("stationId").value= stationId.substr(0,stationId.length-1);
     
     document.getElementById('stationName').value= stationName.substr(0,stationName.length-1);
           
     return;
 }
 function saveValue(stationId,stationName)
 {    
       var flag = false;
     
      if(null != stationId)
      {     
        if(null != strId && 0 != strId.length)
        {
           for(var i = 0; i < strId.length; i++)
           {
               if(strId[i] == stationId)
               {
                  flag = true;   
               }
           }          
        }
        if(!flag)
        {
            strId.push(stationId); 
        } 
      }
      if(null != stationName )
      {
        flag = false;
        
        if(null != strName && 0 != strName.length)
        {
            for(var j = 0; j < strName.length; j++)
            {
                if(strName[j] == stationName)
                {
                    flag = true;   
                }
            }
        }      
        if(!flag)
        {
           strName.push(stationName); 
        }
      
      }
    setValue(strId,strName);
          
 }
 
 function delValue(stationId,stationName)
 {      
      if(null != stationId)
      {
         if(null != strId && 0 != strId.length)
         {
             for(var i = 0; i < strId.length; i++)
             {
                if(stationId == strId[i])
                {
                    strId.splice(i,1);                   
                }
             }
         }       
      }
      if(null != stationName)
      {
         if(null != strName && 0 != strName.length)
         {
             for(var j = 0; j < strName.length; j++)
             {
                if(stationName == strName[j])
                {
                    strName.splice(j,1);
                }
             }
         }        
      }
      
    setValue(strId,strName);        
 }
 
 function validate(myform)
 {
    if(myform.getAttribute("accountCode").value=='')
    {
        alert('请输入账号名称!');  
        
        return false;
    }
    
//      if(myform.getAttribute("areaId").value=='')
//     {
//         alert('请选择区域!');  
        
//         return false;
//     }
 } 
</script>
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
</HEAD>
<BODY>
<form name="myform" method="POST"
	action="../account/modifyAccountInfo.html?accountCode1=${accountCode1}&companyName1=${companyName1}&pages=${pages}"
	onsubmit="return validate(this);">
<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
	<TBODY>
		<TR>
			<TD height="100%" bgcolor="#FFFFFF" class=right_bg>
			<table width="100%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="20">&nbsp;</td>
					<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>&gt;
					<a href="#">账号管理</a> &gt; <a href="#">账号信息维护</a> &gt; 修改账号信息</td>
				</tr>
			</table>
			<table width="100%" height="10" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				background="../images/bg_body_title.jpg" class="list_border1">
				<tr>
					<td width="10">&nbsp;</td>
					<td>
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td></td>
							<td valign="bottom" class="text_12_border">修改账号信息</td>
							<td></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				class="list_border2">
				<tr>
					<td align="center" valign="top">
					<table width="98%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<TABLE class=list_border cellSpacing=0 cellPadding=0 width="98%"
						border=0>
						<input name="accountId" type="hidden" class="INPUT2" height="20"
							value='${userAccountBean.accountId}'>
						<input name="accountCode" type="hidden" class="INPUT2" height="20"
							value='${userAccountBean.accountCode}'>
						<TBODY>
							<TR>
								<TD class=list_td_gray width="140">账号名称 ：</TD>
								<TD class=list_td_white_line>${userAccountBean.accountCode}</TD>
							</TR>
							<TR>
								<TD class=list_td_gray width="140">账号状态 ：</TD>
								<TD class=list_td_white_line><select name="accountState">
									<option value="ENABLE"
										<c:if test="#{userAccountBean.accountState=='ENABLE'}">selected</c:if>>正常</option>
									<option value="DISABLE"
										<c:if test="#{userAccountBean.accountState=='DISABLE'}">selected</c:if>>禁用</option>
								</select> <span class="text_darkred">*</span></TD>
							</TR>

							<TR>
								<TD class=list_td_gray width="140">用户名称 ：</TD>
								<TD class=list_td_white_line><input name="userName"
									type="text" class="INPUT2" height="20"
									value='${userBean.userName}'> <input name="userId"
									type="hidden" class="INPUT2" height="20"
									value='${userBean.userId}'> <span class="text_darkred">*</span></TD>
							</TR>

							
<!-- 							<TR> -->
<!-- 								<TD class=list_td_gray height=30>密码 ：</TD> -->
<!-- 								<TD height=30 class=list_td_white_line><INPUT class=INPUT2 -->
<!-- 									type="password" id=entName22 name="accountPassword" -->
<!-- 									value='${userAccountBean.accountPassword}'></TD> -->
<!-- 							</TR> -->
<!-- 							<TR> -->
<!-- 								<TD class=list_td_gray height=30>确认密码 ：</TD> -->
<!-- 								<TD height=30 class=list_td_white_line><INPUT class=INPUT2 -->
<!-- 									type="password" id=entName22 name="password2" -->
<!-- 									value='${userAccountBean.accountPassword}'></TD> -->
<!-- 							</TR> -->
							
							
<!-- 							<TR> -->
<!-- 								<TD class=list_td_gray height=30>区域 ：</TD> -->
<!-- 								<TD class=list_td_white_line width="88%"><textarea -->
<!-- 									id="areaName" name="areaName" class="input_textarea" -->
<!-- 									readonly="true">${areaName}</textarea> <INPUT class=INPUT2 type="hidden" id=areaId -->
<!-- 									name="areaId" value='${areaId }'><input type="button" name="chooseArea" -->
<!-- 									onclick="openAreaWin();" value="请选择区域"> <span -->
<!-- 									class="text_darkred">*</span></TD> -->
<!-- 							</TR> -->
							
							<TR>
								<TD class=list_td_gray height=30>岗位信息 ：</TD>
								<TD class=list_td_white_line width="88%"><textarea
									id="stationName" name="stationName" class="input_textarea"
									readonly='true'>${stationName}</textarea> <INPUT class=INPUT2
									type="hidden" id=stationId name="stationId"
									value='${stationId}'><input type="button"
									name="chooseRole" onclick="openwin();" value="请选择岗位"></TD>
							</TR>

						</TBODY>
					</TABLE>
					<table width="98%" height="42" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="40%" align="center"><input name="Submit2"
								type="submit" class="button_normal" value="完  成">
							&nbsp;&nbsp; <input name="Submit3" type="button"
								class="button_normal" value="返  回"
								onclick="window.location.href='../account/queryUserAccountInfo.html?accountCode=${accountCode1}&companyName=${companyName1}&pages=${pages}'"></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			<table width="98%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			</TD>
		</TR>
	</TBODY>
</TABLE>
</FORM>
</BODY>
</HTML>
